package org.data;

import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table;
import static org.h2.jaqu.Define.*;

/**
 *
 * @author Dmitriy.M.Krasnov
 */
public class EventORace implements Table {

    public Integer event_id;
    public Integer runrace_id;

    public EventORace() {
        // public constructor
    }

    public EventORace(Integer event_id, Integer runrace_id) {
        this.event_id = event_id;
        this.runrace_id = runrace_id;
    }

    public void define() {
        tableName("EventORace");
        primaryKey(event_id, runrace_id);
    }

    // test
    private static EventORace create(Integer event_id, Integer runrace_id) {
        return new EventORace(event_id, runrace_id);
    }

    // test method
    public static List<EventORace> getList() {
        EventORace[] list = new EventORace[]{
            create(1, 1),
            create(2, 5)
        };
        return Arrays.asList(list);
    }

    @Override
    public String toString() {
        return event_id.toString();
    }
}
